<template>
  <div class="container">
    <div class="left">
      <div class="title">Plant KPI</div>
      <div class="content">
        <div class="item">
          {{ "LTIR Target <" }} {{ list.dou_Monthly_LTIR_Target }}
        </div>
        <div class="item">
          LTIR Actual:
          <span :class="[lTIRActualOverTarget ? 'red' : 'green']">{{
            list.dou_Monthly_LTIR_Actual
          }}</span>
        </div>
        <div class="item">
          {{ "SR Target <" }} {{ list.dou_Monthly_SR_Target }}
        </div>
        <div class="item">
          SR Actual:
          <span :class="[sRActualOverTarget ? 'red' : 'green']">{{
            list.dou_Monthly_SR_Actual
          }}</span>
        </div>
      </div>
    </div>
    <div class="right">
      <div class="title">LWD Cases Count</div>
      <div class="content">
        <div class="item">{{ list.dou_LWD_Cases_Count }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "KPI",
  data() {
    return {
      lTIRActualOverTarget:
        this.list.dou_Monthly_LTIR_Actual >= this.list.dou_Monthly_LTIR_Target,
      sRActualOverTarget:
        this.list.dou_Monthly_SR_Actual >= this.list.dou_Monthly_SR_Target,
    };
  },
  props: {
    list: {
      type: Object,
    },
  },
};
</script>

<style lang="less" scoped>
.container {
  display: flex;
  .red {
    color: #ff0a0a;
  }
  .green {
    color: #2fbe70;
  }
  .left {
    width: 50%;
    .content {
      .item {
        height: 25%;
        margin: 10px;
        padding: 10px;
        font-size: 20px;
      }
    }
  }

  .right {
    width: 50%;
    .content {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100%;
      color: #2fbe70;
      font-size: 40px;
      font-weight: 700;
    }
  }
  .title {
    padding: 4px 20px;
    border-bottom: 2px solid #fff;
    background-color: #ebebeb;
    color: #333;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
  }
}
</style>
